Skip to content

Remove Nonterminal and TokenKind::Interpolated #124141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

nnethercote
Copy link
Contributor

@nnethercote nnethercote commented Apr 18, 2024

A third attempt at this; the first attempt was #96724 and the second was #114647.

r? @ghost

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 18, 2024
@rustbot
Copy link
Collaborator

rustbot commented Apr 18, 2024

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@nnethercote nnethercote marked this pull request as draft April 18, 2024 23:28
@nnethercote nnethercote force-pushed the rm-Nonterminal-and-TokenKind-Interpolated branch 2 times, most recently from 42a623a to c133e16 Compare April 23, 2024 03:51
@petrochenkov petrochenkov self-assigned this Apr 28, 2024
@ijackson
Copy link
Contributor

❤️ @nnethercote for working on this. Thank you! I'm not sure if there's a way for me to help, as someone who doesn't really know much about the compiler innards, but please LMK if you think of something.

@nnethercote
Copy link
Contributor Author

@ijackson: thanks! I'm curious why you are interested in this change, given that it's a compiler internals rearrangement?

@nnethercote
Copy link
Contributor Author

@ijackson: Oh, I see, you are interested in #67062 being fixed. Unfortunately my current thoughts are that this PR alone won't be enough to fix that issue, though it's a necessary stepping stone.

@ijackson
Copy link
Contributor

@ijackson: Oh, I see, you are interested in #67062 being fixed. Unfortunately my current thoughts are that this PR alone won't be enough to fix that issue, though it's a necessary stepping stone.

Right. It seems ... quite nontrivial. So, thanks.

@oriongonza
Copy link
Contributor

After this is done TokenKind will become Copy right?

@nnethercote
Copy link
Contributor Author

After this is done TokenKind will become Copy right?

Yes.

nnethercote added a commit to nnethercote/rust that referenced this pull request May 16, 2024
Instead of using AST pretty printing.

This is a step towards removing `token::Interpolated`, which will
eventually (in rust-lang#124141) be replaced with a token stream within invisible
delimiters.

This changes (improves) the output of the `stringify!` macro in some
cases. This is allowed. As the `stringify!` docs say: "Note that the
expanded results of the input tokens may change in the future. You
should be careful if you rely on the output."

Test changes:

- tests/ui/macros/stringify.rs: this used to test both token stream
  pretty printing and AST pretty printing via different ways of invoking
  of `stringify!` (i.e. `$expr` vs `$tt`). But those two different
  invocations now give the same result, which is a nice consistency
  improvement. This removes the need for the `c2!` macro.

- tests/ui/macros/trace_faulty_macros.rs: there is some sub-optimal
  spacing in the printing of `A { a : a, b : 0, c : _, .. }`, which will
  be fixed in the next commit. The spacing of `1+1` improves -- it now
  matches the formatting in the source code.

- tests/ui/proc-macro/*: minor improvements where small differences
  between `INPUT (DISPLAY)` output and `DEEP-RE-COLLECTED (DISPLAY)`
  output disappear.
@nnethercote nnethercote force-pushed the rm-Nonterminal-and-TokenKind-Interpolated branch from c133e16 to 7aef5db Compare May 16, 2024 10:50
@rust-log-analyzer

This comment has been minimized.

nnethercote added a commit to nnethercote/rust that referenced this pull request May 17, 2024
Instead of using AST pretty printing.

This is a step towards removing `token::Interpolated`, which will
eventually (in rust-lang#124141) be replaced with a token stream within invisible
delimiters.

This changes (improves) the output of the `stringify!` macro in some
cases. This is allowed. As the `stringify!` docs say: "Note that the
expanded results of the input tokens may change in the future. You
should be careful if you rely on the output."

Test changes:

- tests/ui/macros/stringify.rs: this used to test both token stream
  pretty printing and AST pretty printing via different ways of invoking
  of `stringify!` (i.e. `$expr` vs `$tt`). But those two different
  invocations now give the same result, which is a nice consistency
  improvement. This removes the need for the `c2!` macro.

- tests/ui/macros/trace_faulty_macros.rs: there is some sub-optimal
  spacing in the printing of `A { a : a, b : 0, c : _, .. }`, which will
  be fixed in the next commit. The spacing of `1+1` improves -- it now
  matches the formatting in the source code.

- tests/ui/proc-macro/*: minor improvements where small differences
  between `INPUT (DISPLAY)` output and `DEEP-RE-COLLECTED (DISPLAY)`
  output disappear.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 17, 2024
…, r=<try>

Print `token::Interpolated` with token stream pretty printing.

This is a step towards removing `token::Interpolated` (rust-lang#124141). It unavoidably changes the output of the `stringify!` macro, generally for the better.

r? `@petrochenkov`
@nnethercote
Copy link
Contributor Author

nnethercote commented May 17, 2024

#125174 carves off a piece of this PR so it can be merged separately.

@bors

This comment was marked as resolved.

jieyouxu added a commit to jieyouxu/rust that referenced this pull request May 18, 2024
Add tests for `-Zunpretty=expanded` ported from stringify's tests

This PR adds a new set of tests for the AST pretty-printer.

Previously, pretty-printer edge cases were tested by way of `stringify!` in [tests/ui/macros/stringify.rs](https://github.com/rust-lang/rust/blob/1.78.0/tests/ui/macros/stringify.rs), such as the tests added by rust-lang@419b269 and rust-lang@527e2ea.

Those tests will no longer provide effective coverage of the AST pretty-printer after rust-lang#124141. `Nonterminal` and `TokenKind::Interpolated` are being removed, and a consequence is that `stringify!` will perform token stream pretty printing, instead of AST pretty printing, in all of the `stringify!` cases including $:expr and all other interpolations.

This PR adds 2 new ui tests with `compile-flags: -Zunpretty=expanded`:

- **tests/ui/unpretty/expanded-exhaustive.rs** &mdash; this test aims for exhaustive coverage of all the variants of `ExprKind`, `ItemKind`, `PatKind`, `StmtKind`, `TyKind`, and `VisibilityKind`. Some parts could use being fleshed out further, but the current state is roughly on par with what exists in the old stringify-based tests.

- **tests/ui/unpretty/expanded-interpolation.rs** &mdash; this test covers tricky macro metavariable edge cases that require the AST pretty printer to synthesize parentheses in order for the printed code to be valid Rust syntax.

r? `@nnethercote`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 18, 2024
Rollup merge of rust-lang#125236 - dtolnay:expandtest, r=nnethercote

Add tests for `-Zunpretty=expanded` ported from stringify's tests

This PR adds a new set of tests for the AST pretty-printer.

Previously, pretty-printer edge cases were tested by way of `stringify!` in [tests/ui/macros/stringify.rs](https://github.com/rust-lang/rust/blob/1.78.0/tests/ui/macros/stringify.rs), such as the tests added by rust-lang@419b269 and rust-lang@527e2ea.

Those tests will no longer provide effective coverage of the AST pretty-printer after rust-lang#124141. `Nonterminal` and `TokenKind::Interpolated` are being removed, and a consequence is that `stringify!` will perform token stream pretty printing, instead of AST pretty printing, in all of the `stringify!` cases including $:expr and all other interpolations.

This PR adds 2 new ui tests with `compile-flags: -Zunpretty=expanded`:

- **tests/ui/unpretty/expanded-exhaustive.rs** &mdash; this test aims for exhaustive coverage of all the variants of `ExprKind`, `ItemKind`, `PatKind`, `StmtKind`, `TyKind`, and `VisibilityKind`. Some parts could use being fleshed out further, but the current state is roughly on par with what exists in the old stringify-based tests.

- **tests/ui/unpretty/expanded-interpolation.rs** &mdash; this test covers tricky macro metavariable edge cases that require the AST pretty printer to synthesize parentheses in order for the printed code to be valid Rust syntax.

r? `@nnethercote`
nnethercote added a commit to nnethercote/rust that referenced this pull request May 20, 2024
Instead of using AST pretty printing.

This is a step towards removing `token::Interpolated`, which will
eventually (in rust-lang#124141) be replaced with a token stream within invisible
delimiters.

This changes (improves) the output of the `stringify!` macro in some
cases. This is allowed. As the `stringify!` docs say: "Note that the
expanded results of the input tokens may change in the future. You
should be careful if you rely on the output."

Test changes:

- tests/ui/macros/stringify.rs: this used to test both token stream
  pretty printing and AST pretty printing via different ways of invoking
  of `stringify!` (i.e. `$expr` vs `$tt`). But those two different
  invocations now give the same result, which is a nice consistency
  improvement. This removes the need for all the `c2*` macros. The AST
  pretty printer now has more thorough testing thanks to rust-lang#125236.

- tests/ui/proc-macro/*: minor improvements where small differences
  between `INPUT (DISPLAY)` output and `DEEP-RE-COLLECTED (DISPLAY)`
  output disappear.
@petrochenkov
Copy link
Contributor

petrochenkov commented May 23, 2024

It's great to see that enum InvisibleOrigin allows to migrate the parser to delimited groups relatively simply, with just the maybe_whole to maybe_reparse_metavar_seq replacement.

Of course it prevents a lot of interesting stuff like reparsing expr as pat and similar, like it would work in a purely token-based model, but all that can be carefully introduced later, when it's possible to do backward compatibly.

@petrochenkov
Copy link
Contributor

How hard would it be to get this to a perf run?
(With or without the NtExpr/NtLiteral stuff.)

@petrochenkov
Copy link
Contributor

Blocked on #125174.
@rustbot blocked

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 23, 2024
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 14, 2025
@bors
Copy link
Collaborator

bors commented Apr 14, 2025

⌛ Testing commit 1830245 with merge f836ae4...

@bors
Copy link
Collaborator

bors commented Apr 14, 2025

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing f836ae4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 14, 2025
@bors bors merged commit f836ae4 into rust-lang:master Apr 14, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 14, 2025
Copy link

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 15f58c4 (parent) -> f836ae4 (this PR)

Test differences

Show 14 test diffs

Additionally, 14 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Job duration changes

  1. x86_64-apple-2: 4712.2s -> 6406.2s (36.0%)
  2. dist-x86_64-apple: 7203.2s -> 8743.1s (21.4%)
  3. dist-apple-various: 6106.7s -> 7268.0s (19.0%)
  4. dist-aarch64-apple: 5768.9s -> 4724.0s (-18.1%)
  5. dist-x86_64-netbsd: 5856.7s -> 5003.6s (-14.6%)
  6. x86_64-apple-1: 9425.3s -> 8687.7s (-7.8%)
  7. dist-armv7-linux: 5262.9s -> 5598.6s (6.4%)
  8. x86_64-msvc-ext3: 7580.4s -> 7985.6s (5.3%)
  9. dist-aarch64-linux: 5511.4s -> 5225.7s (-5.2%)
  10. x86_64-msvc-ext2: 5866.5s -> 6110.3s (4.2%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f836ae4): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
1.0% [0.3%, 2.1%] 11
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-1.4%, -0.2%] 48
Improvements ✅
(secondary)
-1.0% [-2.4%, -0.3%] 36
All ❌✅ (primary) -0.2% [-1.4%, 2.1%] 59

Max RSS (memory usage)

Results (secondary -1.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.5% [0.9%, 2.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-7.5% [-7.5%, -7.5%] 1
All ❌✅ (primary) - - 0

Cycles

Results (primary -1.3%, secondary 3.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.9% [1.6%, 9.7%] 12
Improvements ✅
(primary)
-1.3% [-1.3%, -1.3%] 1
Improvements ✅
(secondary)
-3.8% [-4.5%, -2.2%] 4
All ❌✅ (primary) -1.3% [-1.3%, -1.3%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 780.383s -> 779.942s (-0.06%)
Artifact size: 365.54 MiB -> 365.12 MiB (-0.11%)

@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label Apr 14, 2025
@nnethercote nnethercote deleted the rm-Nonterminal-and-TokenKind-Interpolated branch April 15, 2025 06:21
petrochenkov added a commit to petrochenkov/rust that referenced this pull request Apr 29, 2025
It's no longer necessary after the removal of nonterminal tokens in rust-lang#124141.
petrochenkov added a commit to petrochenkov/rust that referenced this pull request Apr 29, 2025
It's no longer necessary after the removal of nonterminal tokens in rust-lang#124141.
@nnethercote nnethercote added the relnotes Marks issues that should be documented in the release notes of the next release. label Apr 29, 2025
petrochenkov added a commit to petrochenkov/rust that referenced this pull request Apr 30, 2025
It's no longer necessary after the removal of nonterminal tokens in rust-lang#124141.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 30, 2025
ast: Remove token visiting from AST visitor

It's no longer necessary after the removal of nonterminal tokens in rust-lang#124141.

r? `@nnethercote`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2025
Rollup merge of rust-lang#140450 - petrochenkov:vistok, r=nnethercote

ast: Remove token visiting from AST visitor

It's no longer necessary after the removal of nonterminal tokens in rust-lang#124141.

r? `@nnethercote`
bors added a commit to rust-lang-ci/rust that referenced this pull request May 9, 2025
…olated_BETA, r=nnethercote

[beta] [also fit for beta rollup] [HOTFIX] Don't delay a bug on malformed meta items involving interpolated tokens

Directly fixes rust-lang#140612.

<details><summary>Outdated Information</summary>

Directly fixes the 3 crater regressions reported in rust-lang#137687 (comment) (NB: The containing issue rust-lang#137687 is in fact *not* an instance of these regressions, see rust-lang#137687 (comment)).

</details>

**Why is this a separate PR for `beta`**? Well, the crater regressions were already fixed on master albeit unintentionally so, namely by PR rust-lang#124141 which we **certainly** don't want to backport! So this is simply a hotfix. PR rust-lang#140584 will then provide the regression test for master, too, so it doesn't get 'lost'.

[`@]T-release,` if/once accepted by T-compiler, this PR will be fit for beta rollup and can be cherry-picked.

<details><summary>Slightly Outdated & Irrelevant Information</summary>

FYI, we may also want to (separately) backport PR rust-lang#140584 to [fix] rust-lang#137687 (which, again, is not an instance of the crater regressions) but it's unclear if it's really necessary (since it's fuzzer-generated and I don't know of any real users who are impacted).

</details>

cc `@jdonszelmann`
r? fmease
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request May 19, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [rust](https://github.com/rust-lang/rust) | minor | `1.86.0` -> `1.87.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>rust-lang/rust (rust)</summary>

### [`v1.87.0`](https://github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1870-2025-05-15)

[Compare Source](rust-lang/rust@1.86.0...1.87.0)

\==========================

<a id="1.87.0-Language"></a>

## Language

-   [Stabilize `asm_goto` feature](rust-lang/rust#133870)
-   [Allow parsing open beginning ranges (`..EXPR`) after unary operators `!`, `-`, and `*`](rust-lang/rust#134900).
-   [Don't require method impls for methods with `Self: Sized` bounds in `impl`s for unsized types](rust-lang/rust#135480)
-   [Stabilize `feature(precise_capturing_in_traits)` allowing `use<...>` bounds on return position `impl Trait` in `trait`s](rust-lang/rust#138128)

<a id="1.87.0-Compiler"></a>

## Compiler

-   [x86: make SSE2 required for i686 targets and use it to pass SIMD types](rust-lang/rust#135408)

<a id="1.87.0-Platform-Support"></a>

## Platform Support

-   [Remove `i586-pc-windows-msvc` target](rust-lang/rust#137957)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html

<a id="1.87.0-Libraries"></a>

## Libraries

-   [Stabilize the anonymous pipe API](rust-lang/rust#127154)
-   [Add support for unbounded left/right shift operations](rust-lang/rust#129375)
-   [Print pointer metadata in `Debug` impl of raw pointers](rust-lang/rust#135080)
-   [`Vec::with_capacity` guarantees it allocates with the amount requested, even if `Vec::capacity` returns a different number.](rust-lang/rust#135933)
-   Most `std::arch` intrinsics which don't take pointer arguments can now be called from safe code if the caller has the appropriate target features already enabled (rust-lang/stdarch#1714, rust-lang/stdarch#1716, rust-lang/stdarch#1717)
-   [Undeprecate `env::home_dir`](rust-lang/rust#137327)
-   [Denote `ControlFlow` as `#[must_use]`](rust-lang/rust#137449)
-   [Macros such as `assert_eq!` and `vec!` now support `const {...}` expressions](rust-lang/rust#138162)

<a id="1.87.0-Stabilized-APIs"></a>

## Stabilized APIs

-   [`Vec::extract_if`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.extract_if)
-   [`vec::ExtractIf`](https://doc.rust-lang.org/stable/std/vec/struct.ExtractIf.html)
-   [`LinkedList::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.extract_if)
-   [`linked_list::ExtractIf`](https://doc.rust-lang.org/stable/std/collections/linked_list/struct.ExtractIf.html)
-   [`<[T]>::split_off`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off)
-   [`<[T]>::split_off_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_mut)
-   [`<[T]>::split_off_first`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_first)
-   [`<[T]>::split_off_first_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_first_mut)
-   [`<[T]>::split_off_last`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_last)
-   [`<[T]>::split_off_last_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_last_mut)
-   [`String::extend_from_within`](https://doc.rust-lang.org/stable/alloc/string/struct.String.html#method.extend_from_within)
-   [`os_str::Display`](https://doc.rust-lang.org/stable/std/ffi/os_str/struct.Display.html)
-   [`OsString::display`](https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.display)
-   [`OsStr::display`](https://doc.rust-lang.org/stable/std/ffi/struct.OsStr.html#method.display)
-   [`io::pipe`](https://doc.rust-lang.org/stable/std/io/fn.pipe.html)
-   [`io::PipeReader`](https://doc.rust-lang.org/stable/std/io/struct.PipeReader.html)
-   [`io::PipeWriter`](https://doc.rust-lang.org/stable/std/io/struct.PipeWriter.html)
-   [`impl From<PipeReader> for OwnedHandle`](https://doc.rust-lang.org/stable/std/os/windows/io/struct.OwnedHandle.html#impl-From%3CPipeReader%3E-for-OwnedHandle)
-   [`impl From<PipeWriter> for OwnedHandle`](https://doc.rust-lang.org/stable/std/os/windows/io/struct.OwnedHandle.html#impl-From%3CPipeWriter%3E-for-OwnedHandle)
-   [`impl From<PipeReader> for Stdio`](https://doc.rust-lang.org/stable/std/process/struct.Stdio.html)
-   [`impl From<PipeWriter> for Stdio`](https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CPipeWriter%3E-for-Stdio)
-   [`impl From<PipeReader> for OwnedFd`](https://doc.rust-lang.org/stable/std/os/fd/struct.OwnedFd.html#impl-From%3CPipeReader%3E-for-OwnedFd)
-   [`impl From<PipeWriter> for OwnedFd`](https://doc.rust-lang.org/stable/std/os/fd/struct.OwnedFd.html#impl-From%3CPipeWriter%3E-for-OwnedFd)
-   [`Box<MaybeUninit<T>>::write`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.write)
-   [`impl TryFrom<Vec<u8>> for String`](https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-TryFrom%3CVec%3Cu8%3E%3E-for-String)
-   [`<*const T>::offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset_from_unsigned)
-   [`<*const T>::byte_offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.byte_offset_from_unsigned)
-   [`<*mut T>::offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset_from_unsigned-1)
-   [`<*mut T>::byte_offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.byte_offset_from_unsigned-1)
-   [`NonNull::offset_from_unsigned`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.offset_from_unsigned)
-   [`NonNull::byte_offset_from_unsigned`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.byte_offset_from_unsigned)
-   [`<uN>::cast_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.cast_signed)
-   [`NonZero::<uN>::cast_signed`](https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.cast_signed-5).
-   [`<iN>::cast_unsigned`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.cast_unsigned).
-   [`NonZero::<iN>::cast_unsigned`](https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.cast_unsigned-5).
-   [`<uN>::is_multiple_of`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.is_multiple_of)
-   [`<uN>::unbounded_shl`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.unbounded_shl)
-   [`<uN>::unbounded_shr`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.unbounded_shr)
-   [`<iN>::unbounded_shl`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unbounded_shl)
-   [`<iN>::unbounded_shr`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unbounded_shr)
-   [`<iN>::midpoint`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.midpoint)
-   [`<str>::from_utf8`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8)
-   [`<str>::from_utf8_mut`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8\_mut)
-   [`<str>::from_utf8_unchecked`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8\_unchecked)
-   [`<str>::from_utf8_unchecked_mut`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8\_unchecked_mut)

These previously stable APIs are now stable in const contexts:

-   [`core::str::from_utf8_mut`](https://doc.rust-lang.org/stable/std/str/fn.from_utf8\_mut.html)
-   [`<[T]>::copy_from_slice`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.copy_from_slice)
-   [`SocketAddr::set_ip`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.set_ip)
-   [`SocketAddr::set_port`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.set_port),
-   [`SocketAddrV4::set_ip`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.set_ip)
-   [`SocketAddrV4::set_port`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.set_port),
-   [`SocketAddrV6::set_ip`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_ip)
-   [`SocketAddrV6::set_port`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_port)
-   [`SocketAddrV6::set_flowinfo`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_flowinfo)
-   [`SocketAddrV6::set_scope_id`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_scope_id)
-   [`char::is_digit`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_digit)
-   [`char::is_whitespace`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_whitespace)
-   [`<[[T; N]]>::as_flattened`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_flattened)
-   [`<[[T; N]]>::as_flattened_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_flattened_mut)
-   [`String::into_bytes`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.into_bytes)
-   [`String::as_str`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_str)
-   [`String::capacity`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.capacity)
-   [`String::as_bytes`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_bytes)
-   [`String::len`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.len)
-   [`String::is_empty`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.is_empty)
-   [`String::as_mut_str`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_mut_str)
-   [`String::as_mut_vec`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_mut_vec)
-   [`Vec::as_ptr`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_ptr)
-   [`Vec::as_slice`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_slice)
-   [`Vec::capacity`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.capacity)
-   [`Vec::len`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.len)
-   [`Vec::is_empty`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.is_empty)
-   [`Vec::as_mut_slice`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_mut_slice)
-   [`Vec::as_mut_ptr`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_mut_ptr)

<a id="1.87.0-Cargo"></a>

## Cargo

-   [Add terminal integration via ANSI OSC 9;4 sequences](rust-lang/cargo#14615)
-   [chore: bump openssl to v3](rust-lang/cargo#15232)
-   [feat(package): add --exclude-lockfile flag](rust-lang/cargo#15234)

<a id="1.87.0-Compatibility-Notes"></a>

## Compatibility Notes

-   [Rust now raises an error for macro invocations inside the `#![crate_name]` attribute](rust-lang/rust#127581)
-   [Unstable fields are now always considered to be inhabited](rust-lang/rust#133889)
-   [Macro arguments of unary operators followed by open beginning ranges may now be matched differently](rust-lang/rust#134900)
-   [Make `Debug` impl of raw pointers print metadata if present](rust-lang/rust#135080)
-   [Warn against function pointers using unsupported ABI strings in dependencies](rust-lang/rust#135767)
-   [Associated types on `dyn` types are no longer deduplicated](rust-lang/rust#136458)
-   [Forbid attributes on `..` inside of struct patterns (`let Struct { #[attribute] .. }) =`](rust-lang/rust#136490)
-   [Make `ptr_cast_add_auto_to_object` lint into hard error](rust-lang/rust#136764)
-   Many `std::arch` intrinsics are now safe to call in some contexts, there may now be new `unused_unsafe` warnings in existing codebases.
-   [Limit `width` and `precision` formatting options to 16 bits on all targets](rust-lang/rust#136932)
-   [Turn order dependent trait objects future incompat warning into a hard error](rust-lang/rust#136968)
-   [Denote `ControlFlow` as `#[must_use]`](rust-lang/rust#137449)
-   [Windows: The standard library no longer links `advapi32`, except on win7.](rust-lang/rust#138233) Code such as C libraries that were relying on this assumption may need to explicitly link advapi32.
-   [Proc macros can no longer observe expanded `cfg(true)` attributes.](rust-lang/rust#138844)
-   [Start changing the internal representation of pasted tokens](rust-lang/rust#124141). Certain invalid declarative macros that were previously accepted in obscure circumstances are now correctly rejected by the compiler. Use of a `tt` fragment specifier can often fix these macros.
-   [Don't allow flattened format_args in const.](rust-lang/rust#139624)

<a id="1.87.0-Internal-Changes"></a>

## Internal Changes

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

-   [Update to LLVM 20](rust-lang/rust#135763)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4xMS4xOSIsInVwZGF0ZWRJblZlciI6IjQwLjExLjE5IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. PG-exploit-mitigations Project group: Exploit mitigations relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.